package com.endpoint.author.controller;

import com.endpoint.author.entity.Author;
import com.endpoint.author.service.IAuthorService;
import com.endpoint.common.constant.ResponseStatus;
import com.endpoint.common.exception.BusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 作者表 前端控制器
 * </p>
 *
 * @author liusp
 * @since 2025-06-21
 */
@RestController
@RequestMapping("/author/author")
public class AuthorController {
    @Autowired
    private IAuthorService iAuthorService;
    @GetMapping()
    public List getAll(){
        List<Author> authors = iAuthorService.list();
//        if(true) {
//            throw new BusinessException(ResponseStatus.ERROR);
//        }
        return authors;
    }
}
